package cn.xuetian.logback.demo.controller;

import cn.xuetian.logback.demo.service.ITestService;
import java.util.UUID;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zss
 * @date 2022/5/17 9:55
 * @Email:451682479@qq.com
 */
@Slf4j
@RestController
@RequestMapping("test")
public class TestController {

    @Autowired
    private ITestService testService;

    @GetMapping("test1")
    public String test1() {

        String s = UUID.randomUUID().toString();
        log.info("controller  INFO test/test1 日志" + s);

        log.error("controller ERROR " + s);

        testService.testService();

        return s;

    }

}
